package com.iflytek.cosmo.ocr.model.domain;

import com.iflytek.cosmo.ocr.common.enums.ResultCodeEnum;

/**
 * 返回值状态对象
 * 
 * @author xqxia3
 * @date 2018年5月17日
 */
public class State {

	/** 状态码 */
	private int ok;
	/** 消息描述 */
	private String failed;

	public State(int ok) {
		this.ok = ok;
	}

	public State(ResultCodeEnum codeEnum) {
        this.ok = codeEnum.getCode();
        if (codeEnum != ResultCodeEnum.SUCCESS) {
            this.failed = codeEnum.getDesc();
        }
	}

	public State(int ok, String failed) {
		super();
		this.ok = ok;
		this.failed = failed;
	}

	public int getOk() {
		return ok;
	}

	public void setOk(int ok) {
		this.ok = ok;
	}

	public String getFailed() {
		return failed;
	}

	public void setFailed(String failed) {
		this.failed = failed;
	}

}
